﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FineSoft.ViewModels
{
	public class BooleanToVisibilityConverter : System.Windows.Data.IValueConverter
	{
		#region IValueConverter 成员

		object System.Windows.Data.IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return (bool)value ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
		}

		object System.Windows.Data.IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return (System.Windows.Visibility)value == System.Windows.Visibility.Visible ? true : false;
		}

		#endregion
	}
}